{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "022abdc6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8bca7cc5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>loan_amnt</th>\n",
       "      <th>term</th>\n",
       "      <th>int_rate</th>\n",
       "      <th>grade</th>\n",
       "      <th>home_ownership</th>\n",
       "      <th>emp_length</th>\n",
       "      <th>label</th>\n",
       "      <th>Cash</th>\n",
       "      <th>DirectPay</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>18500.0</td>\n",
       "      <td>36</td>\n",
       "      <td>13.58</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>7000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>16000.0</td>\n",
       "      <td>60</td>\n",
       "      <td>11.98</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>28000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>10.90</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>8300.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4987</th>\n",
       "      <td>107558</td>\n",
       "      <td>32200.0</td>\n",
       "      <td>60</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4988</th>\n",
       "      <td>107571</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>9.44</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4989</th>\n",
       "      <td>107755</td>\n",
       "      <td>16000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>20.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4990</th>\n",
       "      <td>107810</td>\n",
       "      <td>35175.0</td>\n",
       "      <td>36</td>\n",
       "      <td>17.09</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4991</th>\n",
       "      <td>107819</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4992 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      Unnamed: 0  loan_amnt  term  int_rate  grade  home_ownership  \\\n",
       "0              0    18500.0    36     13.58      5               1   \n",
       "1              1     7000.0    36      7.34      7               1   \n",
       "2              2    16000.0    60     11.98      6               1   \n",
       "3              3    28000.0    36     10.90      6               1   \n",
       "4              4     8300.0    36      7.34      7               1   \n",
       "...          ...        ...   ...       ...    ...             ...   \n",
       "4987      107558    32200.0    60     16.02      5               2   \n",
       "4988      107571    10000.0    36      9.44      6               2   \n",
       "4989      107755    16000.0    36     20.00      4               2   \n",
       "4990      107810    35175.0    36     17.09      4               1   \n",
       "4991      107819    10000.0    36     16.02      5               2   \n",
       "\n",
       "      emp_length  label  Cash  DirectPay  \n",
       "0              6      0     1          0  \n",
       "1             10      0     1          0  \n",
       "2              5      0     1          0  \n",
       "3              6      0     1          0  \n",
       "4              4      0     1          0  \n",
       "...          ...    ...   ...        ...  \n",
       "4987           3      1     1          0  \n",
       "4988           0      1     1          0  \n",
       "4989           2      1     1          0  \n",
       "4990          10      1     1          0  \n",
       "4991           5      1     1          0  \n",
       "\n",
       "[4992 rows x 10 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"train.csv\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "4a274764",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>loan_amnt</th>\n",
       "      <th>term</th>\n",
       "      <th>int_rate</th>\n",
       "      <th>grade</th>\n",
       "      <th>home_ownership</th>\n",
       "      <th>emp_length</th>\n",
       "      <th>label</th>\n",
       "      <th>Cash</th>\n",
       "      <th>DirectPay</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>18500.0</td>\n",
       "      <td>36</td>\n",
       "      <td>13.58</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>16000.0</td>\n",
       "      <td>60</td>\n",
       "      <td>11.98</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>28000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>10.90</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8300.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4987</th>\n",
       "      <td>32200.0</td>\n",
       "      <td>60</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4988</th>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>9.44</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4989</th>\n",
       "      <td>16000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>20.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4990</th>\n",
       "      <td>35175.0</td>\n",
       "      <td>36</td>\n",
       "      <td>17.09</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4991</th>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4992 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      loan_amnt  term  int_rate  grade  home_ownership  emp_length  label  \\\n",
       "0       18500.0    36     13.58      5               1           6      0   \n",
       "1        7000.0    36      7.34      7               1          10      0   \n",
       "2       16000.0    60     11.98      6               1           5      0   \n",
       "3       28000.0    36     10.90      6               1           6      0   \n",
       "4        8300.0    36      7.34      7               1           4      0   \n",
       "...         ...   ...       ...    ...             ...         ...    ...   \n",
       "4987    32200.0    60     16.02      5               2           3      1   \n",
       "4988    10000.0    36      9.44      6               2           0      1   \n",
       "4989    16000.0    36     20.00      4               2           2      1   \n",
       "4990    35175.0    36     17.09      4               1          10      1   \n",
       "4991    10000.0    36     16.02      5               2           5      1   \n",
       "\n",
       "      Cash  DirectPay  \n",
       "0        1          0  \n",
       "1        1          0  \n",
       "2        1          0  \n",
       "3        1          0  \n",
       "4        1          0  \n",
       "...    ...        ...  \n",
       "4987     1          0  \n",
       "4988     1          0  \n",
       "4989     1          0  \n",
       "4990     1          0  \n",
       "4991     1          0  \n",
       "\n",
       "[4992 rows x 9 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.drop([\"Unnamed: 0\"],axis=1,inplace=True)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c6538210",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       0\n",
       "1       0\n",
       "2       0\n",
       "3       0\n",
       "4       0\n",
       "       ..\n",
       "4987    1\n",
       "4988    1\n",
       "4989    1\n",
       "4990    1\n",
       "4991    1\n",
       "Name: label, Length: 4992, dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = df['label']\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "15603a98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>loan_amnt</th>\n",
       "      <th>term</th>\n",
       "      <th>int_rate</th>\n",
       "      <th>grade</th>\n",
       "      <th>home_ownership</th>\n",
       "      <th>emp_length</th>\n",
       "      <th>Cash</th>\n",
       "      <th>DirectPay</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>18500.0</td>\n",
       "      <td>36</td>\n",
       "      <td>13.58</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>16000.0</td>\n",
       "      <td>60</td>\n",
       "      <td>11.98</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>28000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>10.90</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8300.0</td>\n",
       "      <td>36</td>\n",
       "      <td>7.34</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4987</th>\n",
       "      <td>32200.0</td>\n",
       "      <td>60</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4988</th>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>9.44</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4989</th>\n",
       "      <td>16000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>20.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4990</th>\n",
       "      <td>35175.0</td>\n",
       "      <td>36</td>\n",
       "      <td>17.09</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4991</th>\n",
       "      <td>10000.0</td>\n",
       "      <td>36</td>\n",
       "      <td>16.02</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4992 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      loan_amnt  term  int_rate  grade  home_ownership  emp_length  Cash  \\\n",
       "0       18500.0    36     13.58      5               1           6     1   \n",
       "1        7000.0    36      7.34      7               1          10     1   \n",
       "2       16000.0    60     11.98      6               1           5     1   \n",
       "3       28000.0    36     10.90      6               1           6     1   \n",
       "4        8300.0    36      7.34      7               1           4     1   \n",
       "...         ...   ...       ...    ...             ...         ...   ...   \n",
       "4987    32200.0    60     16.02      5               2           3     1   \n",
       "4988    10000.0    36      9.44      6               2           0     1   \n",
       "4989    16000.0    36     20.00      4               2           2     1   \n",
       "4990    35175.0    36     17.09      4               1          10     1   \n",
       "4991    10000.0    36     16.02      5               2           5     1   \n",
       "\n",
       "      DirectPay  \n",
       "0             0  \n",
       "1             0  \n",
       "2             0  \n",
       "3             0  \n",
       "4             0  \n",
       "...         ...  \n",
       "4987          0  \n",
       "4988          0  \n",
       "4989          0  \n",
       "4990          0  \n",
       "4991          0  \n",
       "\n",
       "[4992 rows x 8 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.drop(\"label\",axis=1,inplace=True)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7d93f8f4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "std =StandardScaler()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d573f699",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.16642794, -0.74410224, -0.11449683, ...,  0.02961412,\n",
       "         0.23009219, -0.23009219],\n",
       "       [-0.92857942, -0.74410224, -1.22212176, ...,  1.11662646,\n",
       "         0.23009219, -0.23009219],\n",
       "       [-0.07161714,  1.34390135, -0.39850322, ..., -0.24213897,\n",
       "         0.23009219, -0.23009219],\n",
       "       ...,\n",
       "       [-0.07161714, -0.74410224,  1.02507881, ..., -1.05739822,\n",
       "         0.23009219, -0.23009219],\n",
       "       [ 1.75418861, -0.74410224,  0.50854219, ...,  1.11662646,\n",
       "         0.23009219, -0.23009219],\n",
       "       [-0.64292533, -0.74410224,  0.31861291, ..., -0.24213897,\n",
       "         0.23009219, -0.23009219]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "std_x = std.fit_transform(df)\n",
    "std_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ab4e98fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.166428</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>-0.114497</td>\n",
       "      <td>-0.136726</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>0.029614</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.928579</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>-1.222122</td>\n",
       "      <td>1.465475</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>1.116626</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.071617</td>\n",
       "      <td>1.343901</td>\n",
       "      <td>-0.398503</td>\n",
       "      <td>0.664374</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>-0.242139</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.070999</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>-0.590208</td>\n",
       "      <td>0.664374</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>0.029614</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.804796</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>-1.222122</td>\n",
       "      <td>1.465475</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>-0.513892</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4987</th>\n",
       "      <td>1.470915</td>\n",
       "      <td>1.343901</td>\n",
       "      <td>0.318613</td>\n",
       "      <td>-0.136726</td>\n",
       "      <td>0.420881</td>\n",
       "      <td>-0.785645</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4988</th>\n",
       "      <td>-0.642925</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>-0.849363</td>\n",
       "      <td>0.664374</td>\n",
       "      <td>0.420881</td>\n",
       "      <td>-1.600904</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4989</th>\n",
       "      <td>-0.071617</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>1.025079</td>\n",
       "      <td>-0.937827</td>\n",
       "      <td>0.420881</td>\n",
       "      <td>-1.057398</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4990</th>\n",
       "      <td>1.754189</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>0.508542</td>\n",
       "      <td>-0.937827</td>\n",
       "      <td>-1.013275</td>\n",
       "      <td>1.116626</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4991</th>\n",
       "      <td>-0.642925</td>\n",
       "      <td>-0.744102</td>\n",
       "      <td>0.318613</td>\n",
       "      <td>-0.136726</td>\n",
       "      <td>0.420881</td>\n",
       "      <td>-0.242139</td>\n",
       "      <td>0.230092</td>\n",
       "      <td>-0.230092</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4992 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             0         1         2         3         4         5         6  \\\n",
       "0     0.166428 -0.744102 -0.114497 -0.136726 -1.013275  0.029614  0.230092   \n",
       "1    -0.928579 -0.744102 -1.222122  1.465475 -1.013275  1.116626  0.230092   \n",
       "2    -0.071617  1.343901 -0.398503  0.664374 -1.013275 -0.242139  0.230092   \n",
       "3     1.070999 -0.744102 -0.590208  0.664374 -1.013275  0.029614  0.230092   \n",
       "4    -0.804796 -0.744102 -1.222122  1.465475 -1.013275 -0.513892  0.230092   \n",
       "...        ...       ...       ...       ...       ...       ...       ...   \n",
       "4987  1.470915  1.343901  0.318613 -0.136726  0.420881 -0.785645  0.230092   \n",
       "4988 -0.642925 -0.744102 -0.849363  0.664374  0.420881 -1.600904  0.230092   \n",
       "4989 -0.071617 -0.744102  1.025079 -0.937827  0.420881 -1.057398  0.230092   \n",
       "4990  1.754189 -0.744102  0.508542 -0.937827 -1.013275  1.116626  0.230092   \n",
       "4991 -0.642925 -0.744102  0.318613 -0.136726  0.420881 -0.242139  0.230092   \n",
       "\n",
       "             7  \n",
       "0    -0.230092  \n",
       "1    -0.230092  \n",
       "2    -0.230092  \n",
       "3    -0.230092  \n",
       "4    -0.230092  \n",
       "...        ...  \n",
       "4987 -0.230092  \n",
       "4988 -0.230092  \n",
       "4989 -0.230092  \n",
       "4990 -0.230092  \n",
       "4991 -0.230092  \n",
       "\n",
       "[4992 rows x 8 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "std_x = pd.DataFrame(std_x)\n",
    "std_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "1e326472",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a36960e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train,x_test,y_train,y_test = train_test_split(std_x,y,test_size=0.2,random_state=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "c4968c7c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3993, 999, 999, 3993)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(x_train),len(x_test),len(y_test),len(y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "ad169321",
   "metadata": {},
   "outputs": [],
   "source": [
    "from xgboost import XGBClassifier"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "be01898c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[08:51:47] WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.5.1/src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'binary:logistic' was changed from 'error' to 'logloss'. Explicitly set eval_metric if you'd like to restore the old behavior.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Develop Tools\\anaconda\\envs\\ml\\lib\\site-packages\\xgboost\\sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].\n",
      "  warnings.warn(label_encoder_deprecation_msg, UserWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=1,\n",
       "              colsample_bynode=1, colsample_bytree=1, enable_categorical=False,\n",
       "              gamma=0, gpu_id=-1, importance_type=None,\n",
       "              interaction_constraints='', learning_rate=0.300000012,\n",
       "              max_delta_step=0, max_depth=6, min_child_weight=1, missing=nan,\n",
       "              monotone_constraints='()', n_estimators=100, n_jobs=8,\n",
       "              num_parallel_tree=1, predictor='auto', random_state=0,\n",
       "              reg_alpha=0, reg_lambda=1, scale_pos_weight=1, subsample=1,\n",
       "              tree_method='exact', validate_parameters=1, verbosity=None)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model = XGBClassifier()\n",
    "model.fit(x_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "294df3b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = model.predict(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "94c9df88",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn import metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "729f4f3f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "87.59%\n"
     ]
    }
   ],
   "source": [
    "acc = accuracy_score(y_test,y_pred)\n",
    "print(\"%.2f%%\"%(acc*100))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "70d3cb63",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function precision_score in module sklearn.metrics._classification:\n",
      "\n",
      "precision_score(y_true, y_pred, *, labels=None, pos_label=1, average='binary', sample_weight=None, zero_division='warn')\n",
      "    Compute the precision\n",
      "    \n",
      "    The precision is the ratio ``tp / (tp + fp)`` where ``tp`` is the number of\n",
      "    true positives and ``fp`` the number of false positives. The precision is\n",
      "    intuitively the ability of the classifier not to label as positive a sample\n",
      "    that is negative.\n",
      "    \n",
      "    The best value is 1 and the worst value is 0.\n",
      "    \n",
      "    Read more in the :ref:`User Guide <precision_recall_f_measure_metrics>`.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    y_true : 1d array-like, or label indicator array / sparse matrix\n",
      "        Ground truth (correct) target values.\n",
      "    \n",
      "    y_pred : 1d array-like, or label indicator array / sparse matrix\n",
      "        Estimated targets as returned by a classifier.\n",
      "    \n",
      "    labels : list, optional\n",
      "        The set of labels to include when ``average != 'binary'``, and their\n",
      "        order if ``average is None``. Labels present in the data can be\n",
      "        excluded, for example to calculate a multiclass average ignoring a\n",
      "        majority negative class, while labels not present in the data will\n",
      "        result in 0 components in a macro average. For multilabel targets,\n",
      "        labels are column indices. By default, all labels in ``y_true`` and\n",
      "        ``y_pred`` are used in sorted order.\n",
      "    \n",
      "        .. versionchanged:: 0.17\n",
      "           parameter *labels* improved for multiclass problem.\n",
      "    \n",
      "    pos_label : str or int, 1 by default\n",
      "        The class to report if ``average='binary'`` and the data is binary.\n",
      "        If the data are multiclass or multilabel, this will be ignored;\n",
      "        setting ``labels=[pos_label]`` and ``average != 'binary'`` will report\n",
      "        scores for that label only.\n",
      "    \n",
      "    average : string, [None, 'binary' (default), 'micro', 'macro', 'samples',                        'weighted']\n",
      "        This parameter is required for multiclass/multilabel targets.\n",
      "        If ``None``, the scores for each class are returned. Otherwise, this\n",
      "        determines the type of averaging performed on the data:\n",
      "    \n",
      "        ``'binary'``:\n",
      "            Only report results for the class specified by ``pos_label``.\n",
      "            This is applicable only if targets (``y_{true,pred}``) are binary.\n",
      "        ``'micro'``:\n",
      "            Calculate metrics globally by counting the total true positives,\n",
      "            false negatives and false positives.\n",
      "        ``'macro'``:\n",
      "            Calculate metrics for each label, and find their unweighted\n",
      "            mean.  This does not take label imbalance into account.\n",
      "        ``'weighted'``:\n",
      "            Calculate metrics for each label, and find their average weighted\n",
      "            by support (the number of true instances for each label). This\n",
      "            alters 'macro' to account for label imbalance; it can result in an\n",
      "            F-score that is not between precision and recall.\n",
      "        ``'samples'``:\n",
      "            Calculate metrics for each instance, and find their average (only\n",
      "            meaningful for multilabel classification where this differs from\n",
      "            :func:`accuracy_score`).\n",
      "    \n",
      "    sample_weight : array-like of shape (n_samples,), default=None\n",
      "        Sample weights.\n",
      "    \n",
      "    zero_division : \"warn\", 0 or 1, default=\"warn\"\n",
      "        Sets the value to return when there is a zero division. If set to\n",
      "        \"warn\", this acts as 0, but warnings are also raised.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    precision : float (if average is not None) or array of float, shape =        [n_unique_labels]\n",
      "        Precision of the positive class in binary classification or weighted\n",
      "        average of the precision of each class for the multiclass task.\n",
      "    \n",
      "    See also\n",
      "    --------\n",
      "    precision_recall_fscore_support, multilabel_confusion_matrix\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    >>> from sklearn.metrics import precision_score\n",
      "    >>> y_true = [0, 1, 2, 0, 1, 2]\n",
      "    >>> y_pred = [0, 2, 1, 0, 0, 1]\n",
      "    >>> precision_score(y_true, y_pred, average='macro')\n",
      "    0.22...\n",
      "    >>> precision_score(y_true, y_pred, average='micro')\n",
      "    0.33...\n",
      "    >>> precision_score(y_true, y_pred, average='weighted')\n",
      "    0.22...\n",
      "    >>> precision_score(y_true, y_pred, average=None)\n",
      "    array([0.66..., 0.        , 0.        ])\n",
      "    >>> y_pred = [0, 0, 0, 0, 0, 0]\n",
      "    >>> precision_score(y_true, y_pred, average=None)\n",
      "    array([0.33..., 0.        , 0.        ])\n",
      "    >>> precision_score(y_true, y_pred, average=None, zero_division=1)\n",
      "    array([0.33..., 1.        , 1.        ])\n",
      "    \n",
      "    Notes\n",
      "    -----\n",
      "    When ``true positive + false positive == 0``, precision returns 0 and\n",
      "    raises ``UndefinedMetricWarning``. This behavior can be\n",
      "    modified with ``zero_division``.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(metrics.precision_score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "7c8e64e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.84509466, 0.91866029])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "precision = metrics.precision_score(y_test,y_pred,average=None)\n",
    "precision"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2dd58b31",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function recall_score in module sklearn.metrics._classification:\n",
      "\n",
      "recall_score(y_true, y_pred, *, labels=None, pos_label=1, average='binary', sample_weight=None, zero_division='warn')\n",
      "    Compute the recall\n",
      "    \n",
      "    The recall is the ratio ``tp / (tp + fn)`` where ``tp`` is the number of\n",
      "    true positives and ``fn`` the number of false negatives. The recall is\n",
      "    intuitively the ability of the classifier to find all the positive samples.\n",
      "    \n",
      "    The best value is 1 and the worst value is 0.\n",
      "    \n",
      "    Read more in the :ref:`User Guide <precision_recall_f_measure_metrics>`.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    y_true : 1d array-like, or label indicator array / sparse matrix\n",
      "        Ground truth (correct) target values.\n",
      "    \n",
      "    y_pred : 1d array-like, or label indicator array / sparse matrix\n",
      "        Estimated targets as returned by a classifier.\n",
      "    \n",
      "    labels : list, optional\n",
      "        The set of labels to include when ``average != 'binary'``, and their\n",
      "        order if ``average is None``. Labels present in the data can be\n",
      "        excluded, for example to calculate a multiclass average ignoring a\n",
      "        majority negative class, while labels not present in the data will\n",
      "        result in 0 components in a macro average. For multilabel targets,\n",
      "        labels are column indices. By default, all labels in ``y_true`` and\n",
      "        ``y_pred`` are used in sorted order.\n",
      "    \n",
      "        .. versionchanged:: 0.17\n",
      "           parameter *labels* improved for multiclass problem.\n",
      "    \n",
      "    pos_label : str or int, 1 by default\n",
      "        The class to report if ``average='binary'`` and the data is binary.\n",
      "        If the data are multiclass or multilabel, this will be ignored;\n",
      "        setting ``labels=[pos_label]`` and ``average != 'binary'`` will report\n",
      "        scores for that label only.\n",
      "    \n",
      "    average : string, [None, 'binary' (default), 'micro', 'macro', 'samples',                        'weighted']\n",
      "        This parameter is required for multiclass/multilabel targets.\n",
      "        If ``None``, the scores for each class are returned. Otherwise, this\n",
      "        determines the type of averaging performed on the data:\n",
      "    \n",
      "        ``'binary'``:\n",
      "            Only report results for the class specified by ``pos_label``.\n",
      "            This is applicable only if targets (``y_{true,pred}``) are binary.\n",
      "        ``'micro'``:\n",
      "            Calculate metrics globally by counting the total true positives,\n",
      "            false negatives and false positives.\n",
      "        ``'macro'``:\n",
      "            Calculate metrics for each label, and find their unweighted\n",
      "            mean.  This does not take label imbalance into account.\n",
      "        ``'weighted'``:\n",
      "            Calculate metrics for each label, and find their average weighted\n",
      "            by support (the number of true instances for each label). This\n",
      "            alters 'macro' to account for label imbalance; it can result in an\n",
      "            F-score that is not between precision and recall.\n",
      "        ``'samples'``:\n",
      "            Calculate metrics for each instance, and find their average (only\n",
      "            meaningful for multilabel classification where this differs from\n",
      "            :func:`accuracy_score`).\n",
      "    \n",
      "    sample_weight : array-like of shape (n_samples,), default=None\n",
      "        Sample weights.\n",
      "    \n",
      "    zero_division : \"warn\", 0 or 1, default=\"warn\"\n",
      "        Sets the value to return when there is a zero division. If set to\n",
      "        \"warn\", this acts as 0, but warnings are also raised.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    recall : float (if average is not None) or array of float, shape =        [n_unique_labels]\n",
      "        Recall of the positive class in binary classification or weighted\n",
      "        average of the recall of each class for the multiclass task.\n",
      "    \n",
      "    See also\n",
      "    --------\n",
      "    precision_recall_fscore_support, balanced_accuracy_score,\n",
      "    multilabel_confusion_matrix\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    >>> from sklearn.metrics import recall_score\n",
      "    >>> y_true = [0, 1, 2, 0, 1, 2]\n",
      "    >>> y_pred = [0, 2, 1, 0, 0, 1]\n",
      "    >>> recall_score(y_true, y_pred, average='macro')\n",
      "    0.33...\n",
      "    >>> recall_score(y_true, y_pred, average='micro')\n",
      "    0.33...\n",
      "    >>> recall_score(y_true, y_pred, average='weighted')\n",
      "    0.33...\n",
      "    >>> recall_score(y_true, y_pred, average=None)\n",
      "    array([1., 0., 0.])\n",
      "    >>> y_true = [0, 0, 0, 0, 0, 0]\n",
      "    >>> recall_score(y_true, y_pred, average=None)\n",
      "    array([0.5, 0. , 0. ])\n",
      "    >>> recall_score(y_true, y_pred, average=None, zero_division=1)\n",
      "    array([0.5, 1. , 1. ])\n",
      "    \n",
      "    Notes\n",
      "    -----\n",
      "    When ``true positive + false negative == 0``, recall returns 0 and raises\n",
      "    ``UndefinedMetricWarning``. This behavior can be modified with\n",
      "    ``zero_division``.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(metrics.recall_score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "fe63edb9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.9352381 , 0.81012658])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recall = metrics.recall_score(y_test,y_pred,average=None)\n",
    "recall"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "e76107ef",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "rfc = RandomForestClassifier(n_estimators=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "b825af30",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RandomForestClassifier()"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rfc.fit(x_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "ca0feb48",
   "metadata": {},
   "outputs": [],
   "source": [
    "rfc_pred_y = rfc.predict(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "f7bda835",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "85.29%\n"
     ]
    }
   ],
   "source": [
    "acc_rfc = accuracy_score(y_test,rfc_pred_y)\n",
    "print(\"%.2f%%\"%(acc_rfc*100))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e52fa4e2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
